package main;

import java.awt.Font;

import com.onbarcode.barcode.Code128;
import com.onbarcode.barcode.IBarcode;

public class MainApplication {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			// Generating barcode using EAN13 standard.
			Code128 barcode = new Code128();
			
			barcode.setData("DLV123");
			
			// EAN 13 Unit of Measure, pixel, cm, or inch
			barcode.setUom(IBarcode.UOM_PIXEL);
			// EAN 13 bar module width (X) in pixel
			barcode.setX(3f);
			// EAN 13 bar module height (Y) in pixel
			barcode.setY(75f);
			
			// barcode image margins
			barcode.setLeftMargin(0f);
			barcode.setRightMargin(0f);
			barcode.setTopMargin(0f);
			barcode.setBottomMargin(0f);
			
			// barcode image resolution in dpi
			barcode.setResolution(72);
			
			// disply barcode encoding data below the barcode
			barcode.setShowText(true);
			// barcode encoding data font style
			barcode.setTextFont(new Font("Arial", 0, 12));
			// space between barcode and barcode encoding data
			barcode.setTextMargin(6);
			
			//  barcode displaying angle
			barcode.setRotate(IBarcode.ROTATE_0);
			
			barcode.drawBarcode("D:\\hcd.gif");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
